package com.jt.controller;

import com.jt.dto.TaskDto;
import com.jt.enums.SysLogEnum;
import com.jt.pojo.Result;
import com.jt.pojo.Task;
import com.jt.service.TaskService;
import com.jt.utils.log.SysLogAnnotation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 任务controller
 */
@RestController
@RequestMapping("/task")
public class TaskController {
    @Autowired
    private TaskService taskService;

    @PostMapping("selectTaskPage")
    public Result selectTaskPage(@RequestBody TaskDto taskDto) {
//       List<Task> list = taskService.selectTaskPage(taskDto);
        return new Result().setMassage("分页查询").setCode(200).setData(null);
    }

    @GetMapping("/selectTaskAll")
    @SysLogAnnotation(operModul = "select", operType = SysLogEnum.SELECT, operDesc = "查询所有")
    public Result selectTaskAll() {
        List<Task> list = taskService.selectTaskAll();
        return new Result().setMassage("分页查询").setCode(200).setData(list);
    }
}
